package com.ruoyi.yey.config.utils;

import lombok.extern.slf4j.Slf4j;

/**
 * @author 一码
 */
@Slf4j
public class ResultUtil<T> {

    public static <T> ResultVo<T> success(){
        return ResultVo.<T>builder().success(true).code(ResultCodeE.SUCCESS.getCode()).result(null).message("操作成功").build();
    }

    public static <T> ResultVo<T> success(T t){
        return ResultVo.<T>builder().success(true).code(ResultCodeE.SUCCESS.getCode()).result(t).message("操作成功").build();
    }

    public static <T> ResultVo<T> error(Integer code, String msg){
        return ResultVo.<T>builder().success(false).code(code).result(null).message(msg).build();
    }
}
